package com.hotel.services.impl;

import com.hotel.daos.RoleMapper;
import com.hotel.entitys.Role;
import com.hotel.services.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapper;
    @Override
    public List<Role> selAllRole() {
        return roleMapper.selAllRole();
    }

    @Override
    public List<Integer> getCheckedRole(Integer staff_id) {
        return roleMapper.selectCheckedRole(staff_id);
    }

    @Override
    public void deleteStaffRole(Integer staff_id) {
        roleMapper.deleteRoleById(staff_id);
    }

    @Override
    public int updRole(Integer staff_id, List<Integer> list) {
        return roleMapper.updateRoleById(staff_id,list);
    }
}
